home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / Speech Unit Source / UsesSpeechNew next >
Text File  |  1993-09-02  |  955b  |  40 lines

  1.     PROCEDURE TTextEntryDialog.GetTextBBAtItemBB(VAR theText:Str255;ItemNo:INTEGER);
  2.     VAR 
  3.         CharIndex , theType:INTEGER;(* gives the type of the item requested *)
  4.         theTextHdl:Handle;(* gives a handle to the item *)
  5.         txtBox:Rect;(* gives the display rectangle of the item *)
  6.         
  7.         aSpeaker , bSpeaker : TSpeaker ;
  8.         delayLen: LONGINT;
  9.         
  10.         BEGIN
  11.         
  12.             {Standard calls to get text from a dialogue box I made:}
  13.             
  14.             GetDItem (fDialog, ItemNo, theType, theTextHdl, txtBox);
  15.             GetIText (theTextHdl, theText);
  16.             
  17.             new(aSpeaker);
  18.             FailNIL(aSpeaker);
  19.             aSpeaker.ISpeaker(6);            
  20.             
  21.             new(bSpeaker);
  22.             FailNIL(bSpeaker);
  23.             bSpeaker.ISpeaker(9);            
  24.             
  25.             {
  26.             aSpeaker.SpeakStr(theText);
  27.             }
  28.             aSpeaker.SpeakTxt(theTextHdl);
  29.             {
  30.             Delay(6, delayLen);
  31.             Even without this, still there is noticable delay because it takes time
  32.             to read how to pronounce.
  33.             }
  34.             bSpeaker.SpeakTxt(theTextHdl);
  35.             
  36.             aSpeaker.free;
  37.             bSpeaker.free;
  38.             
  39.         END;    
  40.